package com.honey.solr;

import org.java.plugin.Plugin;
import org.java.plugin.PluginLifecycleException;

import com.honey.compilation.java.Method;
import com.honey.core.types.FullyQualifiedJavaType;
import com.honey.core.utils.ObjectFactory;
import com.honey.generator.java.GeneratorJavaClassPlugin;
import com.honey.generator.java.GeneratorPresentationLayerCompilation;
import com.honey.generator.java.extension.point.GeneratorJavaClass;
import com.honey.solr.entity.SolrEntity;
import com.honey.solr.model.SolrModel;

public class SolrPresentationLayer extends  GeneratorPresentationLayerCompilation{

	private GeneratorJavaClassPlugin generatorJavaClassPlugin = null;
	private SolrFactory solrFactory = null;
	public SolrPresentationLayer(Plugin belongPlugin) {
		super(belongPlugin);
		try {
			 generatorJavaClassPlugin = ( GeneratorJavaClassPlugin )ObjectFactory.getRequestPlugin(belongPlugin, "honey.generator.java.plugin");
		} catch (PluginLifecycleException e) {
			e.printStackTrace();
		}
		solrFactory = new SolrFactory((SolrPlugin)belongPlugin);
		
	}
	
	@Override
	public GeneratorJavaClass[] getGeneratorJavaClass() {
		return new GeneratorJavaClass[]{
				new SolrEntity(solrFactory),
				new SolrModel(solrFactory),
		};
	}
	
	@Override
	public Method[] layerPublicMethod() {
		
		return null;
	}

	@Override
	public FullyQualifiedJavaType layerType() {
		
		return null;
	}

	@Override
	public FullyQualifiedJavaType[] requestClass() {
		
		return null;
	}
	
	@Override
	public GeneratorJavaClassPlugin getGeneratorJavaClassPlugin() {
		return generatorJavaClassPlugin;
	}
}
